{{extend 'layout.html'}}

<h2>Worker Monitor</h2>

<table>
  <tr>
    <th>Hostname</th>
    <th>Last Heartbeat</th>
    <th>Actions</th>
  </tr>
  {{for worker in workers:}}
  <tr>
    <td>
      {{=A(worker.hostname,_href=URL('inspect_worker',args=worker.hostname))}}
    </td>
    <td {{if (request.now-worker.last_heartbeat).seconds>plugin_celery.HEARTBEAT_EXPIRE:}}style="color:red"{{pass}}>
      {{=worker.last_heartbeat}}
    </td>
    <td>
      {{=A('shutdow',callback=URL('shutdown_worker',args=worker.hostname),delete='tr')}}
    </td>
  </tr>
  {{pass}}
</table>
